import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/layout'

Vue.use(VueRouter)

const routes = [
    {
        path: '/login',
        hidden: true,
        component: () => import('@/views/login/index')
    },
    {
        path: '/',
        component: Layout,
        redirect: '/dashboard',
        children: [{
            path: 'dashboard',
            name: 'dashboard',
            component: () => import('@/views/dashboard/index'),
            meta: { title: '概览', icon: 'dice-d6' },
        }]
    },
    {
        path: '/list',
        component: Layout,
        redirect: '/list/goodsList',
        meta: { title: '列表', icon: 'clipboard-list' },
        children: [{
            path: 'goodsList',
            name: 'goodsList',
            component: () => import('@/views/list/goodsList'),
            meta: { title: '商品列表', icon: 'shopping-bag' },
        },
        {
            path: 'index',
            name: 'index',
            component: () => import('@/views/index/index'),
            meta: { title: '欢迎访问', icon: 'clipboard-list' },
        }]
    }
]

const router = new VueRouter({
    routes
})

export default router
